<script setup>
import { ref, reactive,defineProps } from "vue";
import radomColor from '../../hooks/randomColor'

let color = ref(radomColor())
const props = defineProps({
    title:String,
    author:String,
    time:String,
    desc:String,
})
</script>

<template>
    <section class="center">
        <section class="card">
            <section class="headerImg" :style="`background-color: ${color};`"></section>
            <section style="padding:20px">
                <section class="title">
                {{ props.title }}
                <span class="second" style="float:right;margin-left:2%">{{ props.author }}</span>
                <span class="second" style="float:right">{{ props.time }}</span>
                </section>
                <section class="desc" style="margin-top:2%">{{ props.desc }}</section>
            </section>
        </section>
    </section>
</template>

<style lang="less" scoped>
.center{
    display: flex;
    align-content: center;
    justify-content: center;
    flex-direction: column;
    flex-wrap: wrap;
    .card{
        transition: all 0.6s;
        margin-top: 4vh;
        // width: 80vw; 移动端80
        width: 60vw;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        border-bottom-right-radius: 20px;
        border-bottom-left-radius: 20px;
        background-color: #fff;
        .headerImg{
            height: 5vh;
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
        }
        .title{
            height: 5vh;
            font-size: 25px;
        }
    }
    .card:hover{
        box-shadow:10px 5px 30px gray;
        transform: scale(1.03);
    }
}

.second{
    height: 5vh;
    line-height: 5vh;
    font-size: 15px;
    text-align: center;
}
</style>